package com.apotik.legenda.model;

import java.io.Serializable;
import java.math.BigDecimal;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.Table;

@Entity
@Table(name="apt_sales_transaction_detail")
public class SalesTransactionDetail implements Serializable {
private static final long serialVersionUID = 3448025803207298346L;
	
	@Id
	@GeneratedValue(strategy=GenerationType.IDENTITY)
	@Column(name = "transaction_detail_id")
	private Long transactionDetailId;

	@ManyToOne
	@JoinColumn(name="transaction_id", referencedColumnName = "transaction_id", nullable = false)
	private SalesTransaction transactionId;
	
	@ManyToOne
	@JoinColumn(name="product_id", referencedColumnName = "product_id", nullable = false)
	private Product productId;
	
	@Column(name="ppn", nullable = false)
	private BigDecimal ppn = BigDecimal.ZERO;
	
	@Column(name="discount", nullable = false)
	private BigDecimal discount = BigDecimal.ZERO;
	
	@Column(name="transaction_type", length=50, nullable = false)
	private String transactionType;
	
	@Column(name="count", nullable = false)
	private Integer count = 0;
	
	@Column(name="sell_unit", nullable = false, length=40)
	private String sellUnit = "0";
	
	@Column(name="price", nullable = false)
	private BigDecimal price = BigDecimal.ZERO;
	
	@Column(name="embalase", nullable = false)
	private BigDecimal embalase = BigDecimal.ZERO;
	
	@Column(name="doctor", nullable = false)
	private BigDecimal doctor = BigDecimal.ZERO;
	
	@Column(name="trx_action", nullable = false)
	private BigDecimal trxAction = BigDecimal.ZERO;
	
	@Column(name="laboratory", nullable = false)
	private BigDecimal laboratory = BigDecimal.ZERO;
	
	@Column(name="administration", nullable = false)
	private BigDecimal administration = BigDecimal.ZERO;
	
	@Column(name="misc_fee", nullable = false)
	private BigDecimal miscFee = BigDecimal.ZERO;
	
	@Column(name="remaining_stok", nullable = false)
	private Integer remainingStok = 0;
	
	@Column(name="status", nullable = false)
	private boolean status;
	
	@ManyToOne
	@JoinColumn(name="debt_id", referencedColumnName = "debt_id")
	private EmployeeDebt debtId;
	
	

	public Long getTransactionDetailId() {
		return transactionDetailId;
	}

	public void setTransactionDetailId(Long transactionDetailId) {
		this.transactionDetailId = transactionDetailId;
	}

	public SalesTransaction getTransactionId() {
		return transactionId;
	}

	public void setTransactionId(SalesTransaction transactionId) {
		this.transactionId = transactionId;
	}

	public Product getProductId() {
		return productId;
	}

	public void setProductId(Product productId) {
		this.productId = productId;
	}

	public BigDecimal getPpn() {
		return ppn;
	}

	public void setPpn(BigDecimal ppn) {
		this.ppn = ppn;
	}

	public BigDecimal getDiscount() {
		return discount;
	}

	public void setDiscount(BigDecimal discount) {
		this.discount = discount;
	}

	public String getTransactionType() {
		return transactionType;
	}

	public void setTransactionType(String transactionType) {
		this.transactionType = transactionType;
	}

	public Integer getCount() {
		return count;
	}

	public void setCount(Integer count) {
		this.count = count;
	}

	public String getSellUnit() {
		return sellUnit;
	}

	public void setSellUnit(String sellUnit) {
		this.sellUnit = sellUnit;
	}

	public BigDecimal getPrice() {
		return price;
	}

	public void setPrice(BigDecimal price) {
		this.price = price;
	}

	public BigDecimal getEmbalase() {
		return embalase;
	}

	public void setEmbalase(BigDecimal embalase) {
		this.embalase = embalase;
	}

	public BigDecimal getDoctor() {
		return doctor;
	}

	public void setDoctor(BigDecimal doctor) {
		this.doctor = doctor;
	}

	public BigDecimal getTrxAction() {
		return trxAction;
	}

	public void setTrxAction(BigDecimal trxAction) {
		this.trxAction = trxAction;
	}

	public BigDecimal getLaboratory() {
		return laboratory;
	}

	public void setLaboratory(BigDecimal laboratory) {
		this.laboratory = laboratory;
	}

	public BigDecimal getAdministration() {
		return administration;
	}

	public void setAdministration(BigDecimal administration) {
		this.administration = administration;
	}

	public BigDecimal getMiscFee() {
		return miscFee;
	}

	public void setMiscFee(BigDecimal miscFee) {
		this.miscFee = miscFee;
	}

	public Integer getRemainingStok() {
		return remainingStok;
	}

	public void setRemainingStok(Integer remainingStok) {
		this.remainingStok = remainingStok;
	}

	public boolean isStatus() {
		return status;
	}

	public void setStatus(boolean status) {
		this.status = status;
	}

	public EmployeeDebt getDebtId() {
		return debtId;
	}

	public void setDebtId(EmployeeDebt debtId) {
		this.debtId = debtId;
	}
}
